
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: qian
 * Date: 2022-07-06
 * Time: 16:49
 */
public class Test {
    public static void main(String[] args) {
        MyBinaryTree myBinaryTree=new MyBinaryTree();
        MyBinaryTree.TreeNode root=myBinaryTree.createTree();
        myBinaryTree.size(root);
        System.out.println(MyBinaryTree.count);
        System.out.println(myBinaryTree.size2(root));
        myBinaryTree.leafSize(root);
        System.out.println(MyBinaryTree.leafCount);
        System.out.println(myBinaryTree.leafSize2(root));
        System.out.println(myBinaryTree.getKLevelSize(root,4));
        System.out.println(myBinaryTree.getHeight(root));
        System.out.println(myBinaryTree.find(root, 'B'));
        myBinaryTree.levelOrder(root);

    }
    public static void main2(String[] args) {
        int cnt = 0;
        for (int i = 1; i <= 100; i++) {
            cnt += judge(i);
        }
        System.out.println(cnt);
    }

    public static int judge(int a) {
        int count = 0;
        while (a != 0) {
            int c = a % 10;
            if (c == 9) {
                count++;
            }
            a /= 10;
        }
        return count;
    }
    public static void main1(String[] args) {
        MyBinaryTree myBinaryTree=new MyBinaryTree();
        MyBinaryTree.TreeNode root=myBinaryTree.createTree();
        myBinaryTree.prevOrder(root);
        System.out.println();
        myBinaryTree.inOrder(root);
        System.out.println();
        myBinaryTree.postOrder(root);
    }
}
